//
//  selectButten.m
//  jiajiao
//
//  Created by apple on 16/3/18.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "selectButten.h"
@interface selectButten()
@property(nonatomic,strong)UILabel *selecttitlelable;
@property(nonatomic,strong)UIView *lineview;
@end
@implementation selectButten

-(instancetype)init
{
    if (self = [super init]) {
        [self setUpUI];
    }
    return self;
}
-(void)setUpUI
{
    self.selecttitlelable = [[UILabel alloc]init];
    [self addSubview:self.selecttitlelable];
    
    
    self.lineview = [[UIView alloc]init];
    [self addSubview:self.lineview];
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    self.selecttitlelable.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height-2);
    self.lineview.frame = CGRectMake(0, self.frame.size.height-2, self.frame.size.width, 2);
}
-(void)setSelected:(BOOL)selected
{
    [super setSelected:selected];
    if (selected) {
        self.lineview.backgroundColor = knavcolor;
    }else
    {
        self.lineview.backgroundColor = [UIColor whiteColor];
    }
    
}
@end
